﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for ResultClass
/// </summary>
public class ResultClass:BaseClass
{
  public static int AddReport(Report report)
    {
        string query = String.Format("insert into RESULT values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')"
         , report.ParCode, report.Hemoglobin, report.BloodGR, report.HBSAG, report.HCVAB, report.HIV, report.SYPHILIS, report.Realease);
        return RunDML(query);
    }

  public static int UpdateReport(Report report)
  {
      string query = String.Format("update RESULT set SAMPLE_NO='{0}' ,HEMOGLOBINRATIO='{1}',BLOODGR='{2}',HBSAG='{3}',HCVAB='{4}',HIV='{5}',SYPHILIS='{6}',REALEASE='{7}' where SAMPLE_NO='{0}'"
            , report.ParCode, report.Hemoglobin, report.BloodGR, report.HBSAG, report.HCVAB, report.HIV, report.SYPHILIS, report.Realease);
      return RunDML(query);
  }

  public static DataTable SearchReleaseForm(string Field, string value)
  {
      string query = String.Format("select * from RESULT where {0} like '%{1}%'", Field, value);
      return RunSelect(query);
  }
  public static int DeleteReport(string Id)
  {
      string query = String.Format("delete from RESULT where SAMPLE_NO='{0}'", Id);
      return RunDML(query);
  }
}